//package com.sj.mbt.mvp.presenter.impl;
//
//
//import android.content.Context;
//
//import com.sj.mbt.mvp.callback.OnLikeChangeCallback;
//import com.sj.mbt.mvp.presenter.ILikePresenter;
//import com.sj.mbt.request.AddLikeRequest;
//import com.sj.mbt.request.base.OnResponseListener;
//import com.sj.mbt.request.exception.BmobException;
//
///**
// * Created by huluhong on 2018/7/7.
// * <p>
// * 点赞model
// */
//
//public class LikeImpl implements ILikePresenter {
//
//    @Override
//    public void addLike(Context context,String momentid, final OnLikeChangeCallback onLikeChangeCallback) {
//        if (onLikeChangeCallback == null) return;
//        AddLikeRequest request = new AddLikeRequest(context,momentid);
//        request.setOnResponseListener(new OnResponseListener<String>() {
//            @Override
//            public void onStart(int requestType) {
//
//            }
//
//            @Override
//            public void onSuccess(String response, int requestType) {
//                onLikeChangeCallback.onLike(response);
//            }
//
//            @Override
//            public void onError(BmobException e, int requestType) {
//
//            }
//        });
//        request.execute();
//    }
//
//    @Override
//    public void unLike(Context context,String likesid, final OnLikeChangeCallback onLikeChangeCallback) {
//        if (onLikeChangeCallback == null) return;
//        UnLikeRequest request = new UnLikeRequest(likesid);
//        request.setOnResponseListener(new OnResponseListener<Boolean>() {
//            @Override
//            public void onStart(int requestType) {
//
//            }
//
//            @Override
//            public void onSuccess(Boolean response, int requestType) {
//                if (response) {
//                    onLikeChangeCallback.onUnLike();
//                }
//            }
//
//            @Override
//            public void onError(BmobException e, int requestType) {
//
//            }
//        });
//        request.execute();
//    }
//}
